using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace Main.polls
{
    public partial class myPolls : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                try
                {
                    PollCollection myPolls = new PollCollection();
                    myPolls.FillAllForUser((Guid)Membership.GetUser().ProviderUserKey);

                    foreach (Poll poll in myPolls)
                    {
                        polls.InnerHtml += "<a href='show.aspx?id=" + poll.ID.ToString() + "'>" + poll.Title + "</a><br />";
                    }
                }
                catch (Exception ex)
                {
                    polls.InnerHtml = "No Polls Found";
                }
            }
        }
    }
}
